import {createRouter, createWebHistory, createWebHashHistory} from "vue-router";

const Home = () => import('views/home/Home')
const Cate = () => import('views/cate/Cate')
const Shop = () => import('views/shop/Shop')
const Profile = () => import('views/profile/Profile')
const Detail = () => import('views/detail/Detail')
const dist = 'dist'


const routes = [
  {
    path: '',
    redirect: '/home',
  },
  {
    path: '/dist',
    redirect: '/home',
  },
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: Home,
  },
  {
    path: '/cate',
    component: Cate
  },
  {
    path: '/shop',
    component: Shop
  },
  {
    path: '/profile',
    component: Profile
  },
  {
    path: '/detail/:iid',
    component: Detail
  }
]

const router = createRouter({
  // hash: createWebHashHistory(process.env.BASE_URL),
  history: createWebHistory(process.env.BASE_URL),
  // base: '/',
  routes
})

export default router
